<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  xmlns:resources="clr-namespace:SoftTeach.Resources" xmlns:controls="clr-namespace:SoftTeach.Resources.Controls">
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="../Styles/Farben.xaml"/>
  </ResourceDictionary.MergedDictionaries>

  <Style x:Key="BaseSliderSidesButtonStyle" TargetType="{x:Type RepeatButton}">
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Setter Property="IsTabStop" Value="True"/>
    <Setter Property="Focusable" Value="True"/>
    <Setter Property="Width" Value="18"/>
    <Setter Property="Height" Value="18"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate>
          <Grid>
            <Ellipse
                            Name="external"
                            Stroke="{StaticResource SideButtonsExternalBorderBrush}"
                            StrokeThickness="1"/>
            <Ellipse
                            Name="internal"
                            Margin="1"
                            Fill="{StaticResource SideButtonsBackgroundBrush}"
                            Stroke="{StaticResource SideButtonsInternalBorderBrush}"
                            StrokeThickness="1"/>
            <ContentPresenter
                            Content="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Center"/>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter TargetName="internal" Property="Fill" Value="{DynamicResource DisabledBackgroundBrush}" />
              <Setter TargetName="internal" Property="Stroke" Value="{DynamicResource DisabledBackgroundBrush}" />
              <Setter TargetName="external" Property="Stroke" Value="{DynamicResource DisabledBackgroundBrush}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
              <Setter TargetName="internal" Property="Fill" Value="{StaticResource SideButtonsLightBackgroundBrush}" />
            </Trigger>
            <Trigger Property="RepeatButton.IsPressed" Value="True">
              <Setter TargetName="internal" Property="Fill" Value="{StaticResource SideButtonsPlusLightBackgroundBrush}" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <Style TargetType="{x:Type controls:NumericUpDown}" x:Key="NumericUpDownRoundStyle">
    <Setter Property="HorizontalAlignment" Value="Center"/>
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type controls:NumericUpDown}">
          <Grid Margin="3">
            <Grid.RowDefinitions>
              <RowDefinition/>
              <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
              <ColumnDefinition/>
              <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <Border BorderThickness="1" BorderBrush="Gray" Margin="2" Grid.RowSpan="2" VerticalAlignment="Center" HorizontalAlignment="Stretch">
              <TextBlock Text="{Binding Path=Value,RelativeSource={RelativeSource TemplatedParent}}"  Width="Auto" Padding="5"/>
            </Border>
            <RepeatButton Command="{x:Static controls:NumericUpDown.IncreaseCommand}"  Style="{StaticResource BaseSliderSidesButtonStyle}" Grid.Column="1" Grid.Row="0">
              <Path Fill="{StaticResource GlyphBrush}" Stretch="None">
                <Path.Data>
                  <CombinedGeometry GeometryCombineMode="Union">
                    <CombinedGeometry.Geometry1>
                      <RectangleGeometry Rect="3,0,2,8"></RectangleGeometry>
                    </CombinedGeometry.Geometry1>
                    <CombinedGeometry.Geometry2>
                      <RectangleGeometry Rect="0,3,8,2"></RectangleGeometry>
                    </CombinedGeometry.Geometry2>
                  </CombinedGeometry>
                </Path.Data>
              </Path>
            </RepeatButton>
            <RepeatButton Command="{x:Static controls:NumericUpDown.DecreaseCommand}"  Style="{StaticResource BaseSliderSidesButtonStyle}" Grid.Column="1" Grid.Row="1">
              <Border Width="8" Height="2" Background="{StaticResource GlyphBrush}"></Border>
            </RepeatButton>

          </Grid>

        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>
